package com.blb.community.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 房间 
 * </p>
 *
 * @author 帅帅
 * @since 2022-07-02
 */
@Data
@TableName("zy_room")
@ApiModel(value = "ZyRoom对象", description = "房间 ")
@AllArgsConstructor
@NoArgsConstructor
public class ZyRoom implements Serializable {

    private static final long serialVersionUID = 1L;
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("房间id")
    private Long roomId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("小区id")
    private Long communityId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("楼栋id")
    private Long buildingId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("单元id")
    private Long unitId;

    @ApiModelProperty("楼层")
    private long roomLevel;

    @ApiModelProperty("房间编号")
    private String roomCode;

    @ApiModelProperty("房间名称")
    private String roomName;

    @ApiModelProperty("房屋建筑面积")
    private Double roomAcreage;

    @ApiModelProperty("算费系数")
    private Double roomCost;

    @ApiModelProperty("房屋状态")
    private String roomStatus;

    @ApiModelProperty("是否商铺")
    private String roomIsShop;

    @ApiModelProperty("是否商品房")
    private String roomSCommercialHouse;

    @ApiModelProperty("房屋户型")
    private String roomHouseType;

    @ApiModelProperty("创建者")
    private String createBy;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("更新者")
    private String updateBy;

    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty("备注")
    private String remark;


    //楼栋对象
    @TableField(exist = false)
    private ZyBuilding zyBuilding;
    //
    @TableField(exist = false)
    private ZyCommunity zyCommunity;
    //
    @TableField(exist =false)
    private  ZyUnit zyUnit;


    public ZyRoom(long roomLevel, String roomCode, String roomName) {
        this.roomLevel = roomLevel;
        this.roomCode = roomCode;
        this.roomName = roomName;
    }

    public ZyRoom(long roomId, long roomLevel, String roomCode, String roomName) {
            this.roomId = roomId;
            this.roomLevel = roomLevel;
            this.roomCode = roomCode;
            this.roomName = roomName;
        }
}
